﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Text;

public partial class LeftManagerControl : System.Web.UI.UserControl
{

    private int _type;
    private string _title;

    public int type
    {
        get { return _type; }
        set { _type = value; }
    }
    public string title
    {
        get { return _title; }
        set { _title = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            EntityOprHelper helper = new EntityOprHelper();
            String SQL = " where type= "+_type.ToString()+" order by index ";
            List<T_SYSTEM> tsystem = helper.GetEntityList<T_SYSTEM>(SQL);


            int count = tsystem.Count;

            StringBuilder outContext= new StringBuilder();
            outContext.Append("<table width='95%' height='25' border='0' align='center' cellpadding='2' cellspacing='1' class='left_table'><tr>");
            outContext.Append("<td width='2%'><img src='images/main_sys.gif' width='15' height='17' /></td>");
            outContext.Append("<td width='98%' class='titledaohang'>");
            outContext.Append(_title);
            outContext.Append("</td></tr></table>");



            outContext.Append("<table width='95%' height='25' border='0' align='center' cellpadding='2' cellspacing='1' class='left_table'>");
            outContext.Append("<tr>");
            outContext.Append("<td>");
            for (int i = 0; i < count; i++)
            {
                T_SYSTEM _system=tsystem[i];
                
                outContext.Append("<table cellspacing='0' cellpadding='2' width='96%' align='center' border='0'>");
                outContext.Append(" <tbody>");
                outContext.Append("<tr>");
                outContext.Append("<td width='100%' height='19'><img height='15' src='images/-.gif' width='15' /><A href='");
                
                outContext.Append(_system.address);

                outContext.Append("' target='right'>");
                outContext.Append(_system.showname);

                outContext.Append("</a></td></tr>");
                outContext.Append("</tbody>");
                outContext.Append("</table>");
            }
            outContext.Append("</td>");
            outContext.Append("</tr>");
            outContext.Append("</table>");

            printblock.InnerHtml = outContext.ToString();
           // Page.Response.Write(outContext.ToString());
        }
    }


}
